# -*- coding: utf-8  -*-
# @Time : 2021/9/2  10:20
# @Author : zhangnengbo
# @File : solve.py
# @Company : HPY

import numpy as np
import pandas as pd
from sympy import *

file_data = 'D:\\data\\data_show\\data.xls'
file_parameter = 'D:\\data\\data_show\\parameter.xls'
file_parameter_table = 'D:\\data\\data_show\\parameter_table.xls'

file_data_content = pd.read_excel(file_data)
file_parameter_content = pd.read_excel(file_parameter)
file_parameter_table_content = pd.read_excel(file_parameter_table)

src1 = r'D:\\data\\data_show\\parameter_table.xls'
pardf = pd.read_excel(src1)
em = pardf.iloc[:, 0].values
pem = pardf.iloc[:, 2].values
f1ml = pardf.iloc[:, 4].values
f1mh = pardf.iloc[:, 5].values
par1 = pardf.iloc[:, 7].values

src2 = r'D:\\data\\data_show\\parameter.xls'
csbdf = pd.read_excel(src2, sheet_name='亚克力')
f2m = csbdf.iloc[:, 3:36].values.T

src3 = r'D:\\data\\data_show\\data.xls'
datadf = pd.read_excel(src3)
tl = datadf['TL6'].values
th = datadf['TH6'].values

Ml = par1 * em * pem * (np.e ** (-f1ml - f2m))
Mh = par1 * em * pem * (np.e ** (-f1mh - f2m))

# pl = lk * par1 * em * pem * (np.e ** (-f1ml - f2m))
# ph = hk * par1 * em * pem * (np.e ** (-f1mh - f2m))









x0 = Symbol('x0')
x1 = Symbol('x1')
x2 = Symbol('x2')
x3 = Symbol('x3')
x4 = Symbol('x4')
x5 = Symbol('x5')
x6 = Symbol('x6')
x7 = Symbol('x7')
x8 = Symbol('x8')
x9 = Symbol('x9')
x10 = Symbol('x10')
x11 = Symbol('x11')
x12 = Symbol('x12')
x13 = Symbol('x13')
x14 = Symbol('x14')
x15 = Symbol('x15')
x16 = Symbol('x16')
x17 = Symbol('x17')
x18 = Symbol('x18')
x19 = Symbol('x19')
x20 = Symbol('x20')
x21 = Symbol('x21')
x22 = Symbol('x22')
x23 = Symbol('x23')
x24 = Symbol('x24')
x25 = Symbol('x25')
x26 = Symbol('x26')
x27 = Symbol('x27')
x28 = Symbol('x28')
x29 = Symbol('x29')
x30 = Symbol('x30')

'''
f0 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f1 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f2 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f3 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f4 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f5 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f6 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f7 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f8 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f9 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f10 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f11 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f12 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f13 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f14 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f15 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f16 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f17 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f18 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f19 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f20 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f21 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f22 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f23 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f24 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f25 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f26 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f27 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f28 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f29 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
f30 = x0 x1  x2  x3 x4 x5 x6 x7 x8  x9  x10 x11 x12 x13 x14 x15  x16  x17 x18 x19 x20 x21 x22  x23  x24 x25 x26 x27 x28 x29 x30
'''


'''
result = solve([f0,f1,f2,f3,f4,f5,f6,f7,f8,f9,
                f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,
                f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30
             ],[x0, x1 ,x2, x3, x4, x5, x6, x7, x8, x9, x10,
                x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, 
                x21, x22, x23, x24, x25, x26, x27, x28, x29, x30])
'''